const { config } = require("process")

// 1.数组的解构
const F4 = ['1','3','5','2']
console.log(F4)
// let no1=F4[0]
// let no2=F4[1]
// let no3=F4[2]
// let no4=F4[3]
// 用解构赋值代替上面的内容
let [no1,no2,no3,no4] = F4
console.log(no1)
console.log(no2)
console.log(no3)
console.log(no4)
// 2.对象解构
const fg ={
    username: '冯巩',
    age: '40',
    zhiye: function (){
        console.log('想死你们了')
    },
    set: '男',
    home: '北京市海淀区' 
}

// let username = fg.username
// let age = fg.age
// let zhiye = fg.zhiye
// 用解构赋值代替,下面的{}中函数要写对应的函数名,需要几个参数，写几个
let {username,age,zhiye} = fg
console.log(username)
console.log(age)
zhiye()
